home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson6 / Lesson6.dcr / 00103_on enter Amount.ls < prev    next >
Encoding:
Text File  |  2001-01-25  |  1.0 KB  |  34 lines

  1. property spriteNum
  2. global PaymentInvoiceList
  3.  
  4. on keyDown
  5.   if the key = TAB then
  6.     unfound = "TRUE"
  7.     tAmt = value(member("payfield:Amount").text) + 0.0
  8.     put string(tAmt) into member "payfield:Amount"
  9.     repeat with i = 1 to PaymentInvoiceList.count
  10.       if PaymentInvoiceList[i].InvAmount = tAmt then
  11.         put string(tAmt) into member ("payfield:Payment" & string(i))
  12.         unfound = "FALSE"
  13.         exit repeat
  14.         next repeat
  15.       end if
  16.       put "0.00" into member ("payfield:Payment" & string(i))
  17.     end repeat
  18.     if unfound = "TRUE" then
  19.       repeat with i = 1 to PaymentInvoiceList.count
  20.         if PaymentInvoiceList[i].InvAmount > tAmt then
  21.           put string(tAmt) into member ("payfield:Payment" & string(i))
  22.           tAmt = 0.0
  23.           exit repeat
  24.           next repeat
  25.         end if
  26.         put string(PaymentInvoiceList[i].InvAmount) into member ("payfield:Payment" & string(i))
  27.         tAmt = tAmt - value(PaymentInvoiceList[i].InvAmount)
  28.       end repeat
  29.     end if
  30.     reCalcPayment()
  31.   end if
  32.   pass()
  33. end
  34.